﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="authors1.aspx.vb" Inherits="prueba.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">

        .style1
        {
            width: 211px;
        }
    .style2
    {
        width: 211px;
        height: 30px;
    }
    .style3
    {
        width: 211px;
        height: 29px;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" runat="server" contentplaceholderid="MainContent">
    <table id="table1" style="width:100%;">
    <tr>
        <td>
            <table id="table2" style="width:100%;">
                <tr>
                    <td>
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                            DataKeyNames="au_id" DataSourceID="authors1DataSource1">
                            <Columns>
                                <asp:BoundField DataField="au_id" HeaderText="au_id" ReadOnly="True" 
                                    SortExpression="au_id" />
                                <asp:BoundField DataField="au_lname" HeaderText="au_lname" 
                                    SortExpression="au_lname" />
                                <asp:BoundField DataField="au_fname" HeaderText="au_fname" 
                                    SortExpression="au_fname" />
                                <asp:BoundField DataField="phone" HeaderText="phone" SortExpression="phone" />
                                <asp:BoundField DataField="address" HeaderText="address" 
                                    SortExpression="address" />
                                <asp:BoundField DataField="city" HeaderText="city" SortExpression="city" />
                                <asp:BoundField DataField="state" HeaderText="state" SortExpression="state" />
                                <asp:BoundField DataField="zip" HeaderText="zip" SortExpression="zip" />
                                <asp:CheckBoxField DataField="contract" HeaderText="contract" 
                                    SortExpression="contract" />
                            </Columns>
                        </asp:GridView>
                        <asp:SqlDataSource ID="authors1DataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:pubsConnectionString2 %>" 
                            DeleteCommand="DELETE FROM [authors] WHERE [au_id] = @au_id" 
                            InsertCommand="INSERT INTO [authors] ([au_id], [au_lname], [au_fname], [phone], [address], [city], [state], [zip], [contract]) VALUES (@au_id, @au_lname, @au_fname, @phone, @address, @city, @state, @zip, @contract)" 
                            SelectCommand="SELECT * FROM [authors]" 
                            UpdateCommand="UPDATE [authors] SET [au_lname] = @au_lname, [au_fname] = @au_fname, [phone] = @phone, [address] = @address, [city] = @city, [state] = @state, [zip] = @zip, [contract] = @contract WHERE [au_id] = @au_id">
                            <DeleteParameters>
                                <asp:Parameter Name="au_id" Type="String" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="au_id" Type="String" />
                                <asp:Parameter Name="au_lname" Type="String" />
                                <asp:Parameter Name="au_fname" Type="String" />
                                <asp:Parameter Name="phone" Type="String" />
                                <asp:Parameter Name="address" Type="String" />
                                <asp:Parameter Name="city" Type="String" />
                                <asp:Parameter Name="state" Type="String" />
                                <asp:Parameter Name="zip" Type="String" />
                                <asp:Parameter Name="contract" Type="Boolean" />
                            </InsertParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="au_lname" Type="String" />
                                <asp:Parameter Name="au_fname" Type="String" />
                                <asp:Parameter Name="phone" Type="String" />
                                <asp:Parameter Name="address" Type="String" />
                                <asp:Parameter Name="city" Type="String" />
                                <asp:Parameter Name="state" Type="String" />
                                <asp:Parameter Name="zip" Type="String" />
                                <asp:Parameter Name="contract" Type="Boolean" />
                                <asp:Parameter Name="au_id" Type="String" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                    </td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
        <table id="table3" style="width:100%;">
            <tr>
                <td class="style3">
                    <asp:Label ID="Label1" runat="server" Text="au_id"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox1au_id" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label2" runat="server" Text="au_lname"></asp:Label>
                    <asp:TextBox ID="TxtBox2au_lname" runat="server"></asp:TextBox>
                </td>

            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label3" runat="server" Text="au_fname"></asp:Label>
                    <asp:TextBox ID="TxtBox3au_fname" runat="server"></asp:TextBox>
                </td>

            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label4" runat="server" Text="phone"></asp:Label>
                    <asp:TextBox ID="TxtBox4phone" runat="server"></asp:TextBox>
                </td>

            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label5" runat="server" Text="address"></asp:Label>
                    <asp:TextBox ID="TxtBox5address" runat="server"></asp:TextBox>
                </td>

            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label6" runat="server" Text="city"></asp:Label>
                    <asp:TextBox ID="TxtBox6city" runat="server"></asp:TextBox>
                </td>

            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label7" runat="server" Text="state"></asp:Label>
                    <asp:TextBox ID="TxtBox7state" runat="server"></asp:TextBox>
                </td>

            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label8" runat="server" Text="zip"></asp:Label>
                    <asp:TextBox ID="TxtBox8zip" runat="server"></asp:TextBox>
                </td>

            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label9" runat="server" Text="contract"></asp:Label>
                    <asp:TextBox ID="TxtBox9contract" runat="server"></asp:TextBox>
                </td>

            </tr>
            <tr>
                <td class="style1">
                    <asp:Button ID="Button1" runat="server" Text="Insertar" />
                    <asp:Button ID="Button2" runat="server" Text="BORRAR" style="height: 26px" />
                    <asp:Button ID="Button3" runat="server" Text="Actualizar" />
                </td>
            </tr>
        </table>
    
                    </td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>
        </td>
    </tr>
</table>
</asp:Content>

